package com.example.cinema;

public class UserService {
    // 修改密码
    public static void changePassword(User user) {
        System.out.print("请输入原密码：");
        String oldPwd = CinemaSystem.sc.nextLine();
        if (!oldPwd.equals(user.getPassword())) {
            System.out.println("原密码错误！");
            return;
        }
        System.out.print("请输入新密码：");
        String newPwd = CinemaSystem.sc.nextLine();
        user.setPassword(newPwd);
        System.out.println("密码修改成功！");
    }
}